package com.itheima.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.itheima.MybatisplusApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MpConfig {

    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
//        定义一个拦截器
        MybatisPlusInterceptor mpl = new MybatisPlusInterceptor();
//        添加具体的拦截器，可以添加多个
        mpl.addInnerInterceptor(new PaginationInnerInterceptor());
        return mpl;
    }
}
